
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1.1:路由管理 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="1.2包管理.html" />
    
    
    <link rel="prev" href="5-1第一个Flutter应用.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="5-1第一个Flutter应用.html">
            
                <a href="5-1第一个Flutter应用.html">
            
                    
                    Day1:第一个Flutter应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.2.1" data-path="1.1路由管理.html">
            
                <a href="1.1路由管理.html">
            
                    
                    1.1:路由管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="1.2包管理.html">
            
                <a href="1.2包管理.html">
            
                    
                    1.2:包管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="1.3资源管理.html">
            
                <a href="1.3资源管理.html">
            
                    
                    1.3:资源管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >1.1:路由管理</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="11-&#x8DEF;&#x7531;&#x7BA1;&#x7406;">1.1 &#x8DEF;&#x7531;&#x7BA1;&#x7406;</h1>
<p>&#x8DEF;&#x7531;&#x5728;&#x79FB;&#x52A8;&#x5F00;&#x53D1;&#x4E2D;&#x901A;&#x5E38;&#x6307;&#x9875;&#x9762;(page),&#x4E0E;web&#x5F00;&#x53D1;&#x4E2D;&#x5355;&#x9875;&#x9762;&#x7684;Route&#x6982;&#x5FF5;&#x610F;&#x4E49;&#x76F8;&#x540C;,Android&#x4E2D;&#x901A;&#x5E38;&#x6307;&#x4E00;&#x4E2A;Activity,&#x5728;iOS&#x4E2D;&#x6307;&#x4E00;&#x4E2A;ViewController.
&#x6240;&#x8C13;&#x7684;&#x8DEF;&#x7531;&#x7BA1;&#x8DEF;,&#x5C31;&#x662F;&#x7BA1;&#x7406;&#x9875;&#x9762;&#x4E4B;&#x95F4;&#x5982;&#x4F55;&#x8DF3;&#x8F6C;,&#x4E5F;&#x88AB;&#x6210;&#x4E3A;&#x5BFC;&#x822A;&#x7BA1;&#x7406;.
&#x65E0;&#x8BBA;iOS&#x8FD8;&#x662F;Android,&#x5BFC;&#x822A;&#x7BA1;&#x7406;&#x90FD;&#x4F1A;&#x7EF4;&#x62A4;&#x4E00;&#x4E2A;&#x8DEF;&#x7531;&#x6808;,&#x8DEF;&#x7531;&#x5165;&#x6808;(push)&#x64CD;&#x4F5C;&#x5BF9;&#x5E94;&#x6253;&#x5F00;&#x4E00;&#x4E2A;&#x65B0;&#x9875;&#x9762;,&#x8DEF;&#x7531;&#x51FA;&#x6808;(pop)&#x64CD;&#x4F5C;&#x5BF9;&#x5E94;&#x9875;&#x9762;&#x5173;&#x95ED;&#x64CD;&#x4F5C;,&#x800C;&#x8DEF;&#x7531;&#x7BA1;&#x7406;&#x4E3B;&#x8981;&#x662F;&#x6307;&#x5982;&#x4F55;&#x6765;&#x7BA1;&#x7406;&#x8DEF;&#x7531;&#x6808;.</p>
<h1 id="111-&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x793A;&#x4F8B;">1.1.1 &#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x793A;&#x4F8B;</h1>
<ol>
<li>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x8DEF;&#x7531;,&#x547D;&#x540D;&#x4E3A;NewRoute1 <pre><code class="lang-dart">  <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">NewRoute</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">StatelessWidget</span> </span>{
      <span class="hljs-meta">@override</span>
      Wideget build(Buildcontext context){
         <span class="hljs-keyword">return</span> Scaffold(
             appBar: AppBar(
                 title: Text(<span class="hljs-string">&quot;New route&quot;</span>),
             ),
             body: Center(
                 child: Text(<span class="hljs-string">&quot;This is a new route&quot;</span>),
             ),   
         );
      }
  }
</code></pre>
</li>
<li>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6309;&#x94AE;(Flatbutton)&#x8FDB;&#x884C;&#x5BFC;&#x822A;<pre><code class="lang-dart"> FlatButton(
     child: Text(<span class="hljs-string">&quot;open a new route&quot;</span>),
     textColor: Colors.blue,
     onPress: () {
         <span class="hljs-comment">//&#x5BFC;&#x822A;&#x5230;&#x65B0;&#x8DEF;&#x7531;</span>
         Navigator.push( context,
             MaterialPageRoute(builder: (context) {
             <span class="hljs-keyword">return</span> NewRoute();
             })
         );
     },
 )
</code></pre>
&#x6211;&#x4EEC;&#x6DFB;&#x52A0;&#x4E86;&#x4E00;&#x4E2A;&#x6253;&#x5F00;&#x65B0;&#x8DEF;&#x7531;&#x7684;&#x6309;&#x94AE;&#xFF0C;&#x5E76;&#x5C06;&#x6309;&#x94AE;&#x6587;&#x5B57;&#x989C;&#x8272;&#x8BBE;&#x7F6E;&#x4E3A;&#x84DD;&#x8272;&#xFF0C;&#x70B9;&#x51FB;&#x8BE5;&#x6309;&#x94AE;&#x540E;&#x5C31;&#x4F1A;&#x6253;&#x5F00;&#x65B0;&#x7684;&#x8DEF;&#x7531;&#x9875;&#x9762;&#xFF0C;&#x6548;&#x679C;&#x5982;&#x56FE;1&#x548C;2&#x6240;&#x793A;&#x3002;</li>
</ol>
<p><img src="1.1source/1.png" alt="&#x56FE;:1">
<img src="1.1source/2.png" alt="&#x56FE;:2"></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="5-1第一个Flutter应用.html" class="navigation navigation-prev " aria-label="Previous page: Day1:第一个Flutter应用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="1.2包管理.html" class="navigation navigation-next " aria-label="Next page: 1.2:包管理">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1.1:路由管理","level":"1.2.1","depth":2,"next":{"title":"1.2:包管理","level":"1.2.2","depth":2,"path":"part1/1.2包管理.md","ref":"part1/1.2包管理.md","articles":[]},"previous":{"title":"Day1:第一个Flutter应用","level":"1.2","depth":1,"path":"part1/5-1第一个Flutter应用.md","ref":"part1/5-1第一个Flutter应用.md","articles":[{"title":"1.1:路由管理","level":"1.2.1","depth":2,"path":"part1/1.1路由管理.md","ref":"part1/1.1路由管理.md","articles":[]},{"title":"1.2:包管理","level":"1.2.2","depth":2,"path":"part1/1.2包管理.md","ref":"part1/1.2包管理.md","articles":[]},{"title":"1.3:资源管理","level":"1.2.3","depth":2,"path":"part1/1.3资源管理.md","ref":"part1/1.3资源管理.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"part1/1.1路由管理.md","mtime":"2020-05-01T08:56:28.743Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-05-01T07:29:45.635Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

